
import "./css/index.scss"
import img from "./images/cat.png"
import img2 from "./images/001.jpg"
import axios from "axios"
import jQuery from "jquery"
let btn = document.createElement("button");
btn.textContent = "点击";
btn.classList.add("btn");
document.body.appendChild(btn);
let ig = document.createElement("img");
ig.src = img;
btn.onclick = function(){
  ig.src = ig.src == img?img2:img;
};
document.body.appendChild(ig);
let list = [];
async function cat(){
  let result = await axios.get('/mbcomic/Banner');
  console.log(result);
  if(result.status==200){
    list = result.data.data;
    [].forEach.call(list,(item)=>{
      jQuery(`<div class="title">${item.title}</div>`).prependTo(jQuery("body"));
    });
  }
}
cat();
